#include "cloud.h"
#include "../framework.h"

Vertexf Cloud::vertices[]={Vertexf(100.0f,0.0f)};

Cloud::Cloud(Rectangle rec)
	:SceneObject(rec){

	this->objVertices.vertices = vertices;
	objVertices.nVertices=nVertices;
}

Cloud::~Cloud(){}


CloudA::CloudA(Rectangle rec)
	:Cloud(rec){}

CloudA::~CloudA(){}

void CloudA::draw(){
	Framework& fr = Framework::instance();
	Colorf oldColor = fr.pipeline.getFillColor();
	fr.pipeline.pushMatrix();
        fr.pipeline.setFillColor(Colorf(1.0f,1.0f,1.0f));
        fr.pipeline.translate(this->dimensions.centerX(),this->dimensions.centerY());
        fr.pipeline.escale(this->dimensions.width()/200,this->dimensions.height()/200);
		fr.pipeline.draw(Pipeline::CIRCLES,this->objVertices.vertices,this->objVertices.nVertices);
        fr.pipeline.translate(this->dimensions.width()/2,0);
        fr.pipeline.draw(Pipeline::CIRCLES,this->objVertices.vertices,this->objVertices.nVertices);
    fr.pipeline.popMatrix();
	fr.pipeline.setFillColor(oldColor);
}


CloudB::CloudB(Rectangle rec)
	:Cloud(rec){}

CloudB::~CloudB(){}

void CloudB::draw(){
	Framework& fr = Framework::instance();
	Colorf oldColor = fr.pipeline.getFillColor();
	fr.pipeline.pushMatrix();
        fr.pipeline.setFillColor(Colorf(1.0f,1.0f,1.0f));
		fr.pipeline.escale(this->dimensions.width()/300,this->dimensions.height()/300);
        fr.pipeline.translate(this->dimensions.centerX(),this->dimensions.centerY());
        fr.pipeline.draw(Pipeline::CIRCLES,this->objVertices.vertices,this->objVertices.nVertices);
        fr.pipeline.translate(this->dimensions.width()/3,0);
        fr.pipeline.draw(Pipeline::CIRCLES,this->objVertices.vertices,this->objVertices.nVertices);
        fr.pipeline.translate(-2*this->dimensions.width()/3,0);
        fr.pipeline.draw(Pipeline::CIRCLES,this->objVertices.vertices,this->objVertices.nVertices);
	fr.pipeline.popMatrix();
	fr.pipeline.setFillColor(oldColor);
}



